<div class="notaFiscais index">
	<h2><?php __('Notas Fiscais'); echo ' - '.$mes.' / '.$ano;?></h2>
	
	<div class="mes_ano">
		<?php echo $this->Form->create(false, array('action'=>'index'));?>
		<?php $opcoes=array('1'=>'Janeiro',
							'2'=>'Fevereiro',
							'3'=>'Março',
							'4'=>'Abril',
							'5'=>'Maio',
							'6'=>'Junho',
							'7'=>'Julho',
							'8'=>'Agosto',
							'9'=>'Setembro',
							'10'=>'Outubro',
							'11'=>'Novembro',
							'12'=>'Dezembro'
		); ?>
		<label for="ano">Mês</label>
		<?php echo $this->Form->select('mes',$opcoes, $mes, array('class'=>'texto', 'empty'=>false, 'label'=>'Mês'));?>
		<?php echo $this->Form->input('ano');?>
		<?php echo $form->end('Ver', array('class'=>'button')); ?>
	</div>
	
	<?php echo $this->Html->link(__('Nova Nota Fiscal', true), array('action' => 'add'), array('class'=>'texto')); ?>
	<br><br>
	
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('ID','id_nota_fiscal');?></th>
			<th><?php echo $this->Paginator->sort('Data', 'date_data');?></th>
			<th><?php echo $this->Paginator->sort('Fornecedor', 'fornecedore_id');?></th>
			<th><?php echo $this->Paginator->sort('Número', 'numero_nota');?></th>
			<th><?php echo $this->Paginator->sort('Valor de Produtos', 'money_valor');?></th>
			<th><?php echo $this->Paginator->sort('Valor de IPI', 'money_IPI');?></th>
			<th>Total da Nota</th>
			<th class="actions"><?php __('Opções');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($notaFiscais as $notaFiscai):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="odd"';
		}
	?>
	<tr<?php echo $class;?>>
		<td><?php echo $notaFiscai['NotaFiscai']['id_nota_fiscal']; ?>&nbsp;</td>
		<td><?php echo $notaFiscai['NotaFiscai']['date_data_view']; ?>&nbsp;</td>
		<td><?php echo $notaFiscai['Fornecedore']['razao_social']; ?>&nbsp;</td>
		<td><?php echo $notaFiscai['NotaFiscai']['numero_nota']; ?>&nbsp;</td>
		<td><?php echo $notaFiscai['NotaFiscai']['money_valor_view']; ?>&nbsp;</td>
		<td><?php echo $notaFiscai['NotaFiscai']['money_IPI_view']; ?>&nbsp;</td>
		<td><?php echo 'R$ '.number_format(($notaFiscai['NotaFiscai']['money_valor']+$notaFiscai['NotaFiscai']['money_IPI'])/100,2,',',' ');?>&nbsp;</td>
		<td class="actions">
			<?php echo $this->Html->link(__('Editar', true), array('action' => 'edit', $notaFiscai['NotaFiscai']['id_nota_fiscal'])); ?>
			<?php echo $this->Html->link(__('Apagar', true), array('action' => 'delete', $notaFiscai['NotaFiscai']['id_nota_fiscal']), null, sprintf(__('Tem certeza que deseja apagar a Nota ID = %s?', true), $notaFiscai['NotaFiscai']['id_nota_fiscal'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
	</table>

	<?php if($this->Paginator->numbers()){?>
	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('Anterior', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('Próximo', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
	<?php } ?>
</div>